<template>
  <n-drawer v-bind="getDrawerOptions" @update:show="handleDrawerColse">
    <n-drawer-content closable title="疑似问题核实">
      <TaskAudit :detail="getMission" />
    </n-drawer-content>
  </n-drawer>
</template>

<script>
import TaskAudit from '../../task-audit/index.vue'

import { defineComponent, computed } from 'vue'
export default defineComponent({
  name: 'VerifyDrawer',
  components: { TaskAudit },
  props: {
    /* 可见 */
    visible: {
      type: Boolean,
      default: false
    },
    /* 选中的数据 */
    data: {
      type: Object,
      default: () => {}
    }
  },
  emits: {
    'update:visible': null
  },
  setup(props, { emit }) {
    /* 获取抽屉的信息 */
    const getDrawerOptions = computed(() => {
      return {
        show: props.visible,
        width: 'calc(100% - 210px)',
        placement: 'right'
      }
    })

    /* 获取选中的数据 */
    const getMission = computed(() => {
      return props.data
    })

    function handleDrawerColse() {
      emit('update:visible', false)
    }

    return {
      getDrawerOptions,
      getMission,
      handleDrawerColse
    }
  }
})
</script>

<style scoped lang='scss'>
.n-button+.n-button{
  margin-left: 30px;
}
</style>
